<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>用户登录</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/main.css" />
</head>
<body bgcolor="#fff" >
	<section class="mt common_bg activesignup">
			<section class="tc">
				<form id="loginform" class="fom">
					<p class="form-inpt-p">
						<label>手机号</label><input class="inpt" form="loginform" id="phone" name="phone" type="tel" placeholder="请输入您的手机号码" />
						<input id="" name="memberId" value='${param.memberId}' type="hidden"/>
					</p>
					<p class="form-inpt-p">
						<label>密码</label><input class="inpt" form="loginform" id="password" name="password" type="password" placeholder="请输入您的密码" />
					</p>
					<input class="btn fom-submit loginform-sub" onClick="sumbit()" type="button" value="确 定">
					<p class="login-tips">
						<a href="register.jsp?memberId=${param.memberId}" class="fl">用户注册</a>
						<a href="forgetpassword.jsp" class="fr">忘记密码</a>
					</p> 
					<p class="login-tips pd c">
						<time class="fl grey">会员可绑定账号，下次则可自动登录</time>
						<a href="bindinaccount.jsp?memberId=${param.memberId}" class="fr">立即绑定</a>
					</p>
				</form>
			</section>
	</section>
</body>
<script src="js/jquery.min.js"></script>
<script src="js/main.js"></script>
<script src="js/responsive.js"></script>
<script type="text/javascript">
	function sumbit(){
		var reqDate={
			"phone":$("#phone").val(),
			"memberId":'${param.memberId}',
			"password":$("#password").val()
		};
		$.post("api/userLoginAction/login",reqDate,function(data){
			if(data.code!=0){
				alert(data.errorMessage);
				return;
			}
			if(data.response!=null){
				if(data.response.status==0){
					window.location.href="checking.jsp";
					return;
				}
				if(data.response.status==1){
					window.location.href="myworkaddr.jsp?memberId=${param.memberId}";
					return;
				}
				if(data.response.status==2){
					window.location.href="checking.jsp?userId="+data.response.userId;
					return;
				}
			}
		});
	}
</script>
</html>
